<?php

namespace Database\Seeders;
use DB;
use Illuminate\Database\Seeder;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = \Faker\Factory::create('zh_CN');

        for($i = 0; $i < 100; $i++) {
        	$data = [
        		'uname' => $faker -> name(),
        		'email' => $faker -> email(),
        		'phone' => $faker -> phoneNumber(),
        		'password' => bcrypt('liang0922'),
        		'active' => mt_rand(0,1),
                'role_id' => mt_rand(1,2)
        	];

        	DB::table('user') -> insert($data);
        }
    }
}
